<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        var c = Math.random() * 10 + 1
        var n = parseInt(c)
        console.log(n)

        定义函数取1-m之间的随机数
        function getRandom(m) {
            return parseInt(Math.random() * m + 1)
        }
        console.log (getRandom(100))

        // function getRandom(m,k) {
        //     return parseInt(Math.random() * m + k)
        // }
        // console.log (getRandom(100, 200))
    </script>
</body>
</html>